import { pickedFaceData, pickedLineData, pickedVertexData } from '@amcax/base';
import { Dispatch, SetStateAction } from 'react';

export type ChildHoleProps<
  S extends MinCommonParams = MinCommonParams,
  T extends MinCommonFormData = MinCommonFormData,
> = {
  onClose: VoidFunction;
  props: {
    params: S;
    shape: string;
  };
  editDxid?: string;
  formData: T;
  setFormData: Dispatch<SetStateAction<T>>;
};

export type MinCommonFormData = {
  center: pickedVertexData[];
  vector: pickedFaceData | pickedLineData;
  reverseDir: boolean;
  diameter: number;
  mode: 'distance' | 'next' | 'last' | 'specify';
  surface?: pickedFaceData;
  offset?: number;
  bottomType: '-' | 'v';
  angle?: number;
  depthOption?: 'withoutVBottom' | 'withVBottom';
  depth?: number;
};

export type MinCommonParams = {
  base?: string;
  center: string | string[];
  vector: string;
  reverseDir: boolean;
  diameter: number;
  mode: 'distance' | 'next' | 'last' | 'specify';
  surface?: string;
  offset?: number;
  bottomType: '-' | 'v';
  angle?: number;
  depthOption?: 'withoutVBottom' | 'withVBottom';
  depth?: number;
};
